import { useNavigate, Navigate } from "react-router-dom";
export const RouterAuth=({children})=>{
    const token=localStorage.getItem('token')
    if(!token){//未登录时只能访问login
        return <Navigate to='/login' replace/>
    }
    return(
        children
    )
}